<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="css/bootstrap.css" />
	<link rel="stylesheet" href="wall.css" />
	<title>新联系人</title>
	<script type="text/javascript" src="js/jquery.js"></script>
</head>
<body>
	<div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a href="#" class="brand">项目管理软件</a>
			</div>
		</div>
	</div>
	<div class="container">		
		<form class="person.jspx?_m=sava" action="person.jspx?_m=save" id="myform" method="post">
			<fieldset class="first-1">
				<div>
					<h3 style="height:80px;">修改新联系人</h3>
				</div>	
				<div class="control-group">
					<label class="control-label" >姓名*</label>
					<div class="controls">
						<input type="text" class="span5" name="username" value="${person.name }" ><span id="error_username"></span>						
						<!--  <input type="hidden" name="projectid" value="${project.id }">-->
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" >公司</label>
					<div class="controls">
						<input type="text" class="span5" name="company"value="${person.companyname}" ><span id="error_company"></span>						
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" >手机*</label>
					<div class="controls">
						<input type="text" class="span5" name="phone" value="${person.mobile}"><span id="error_phone"></span>					
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" >固话</label>
					<div class="controls">
						<input type="text" class="span5" name="tel" value="${person.tel}" ><span id="error_tel"></span>						
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" >邮箱</label>
					<div class="controls">
						<input type="text" class="span5" name="email" value="${person.email}"><span id="error_email"></span>						
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" >地址</label>
					<div class="controls">
						<input type="text" class="span5" name="address" value="${person.address}" ><span id="error_address"></span>						
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" >主页</label>
					<div class="controls">
						<input type="text" class="span5" name="book" value="${person.web}"><span id="error_book"></span>
						<p class="help-block">http://www.xxx.com</p>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" >微博</label>
					<div class="controls">
						<select class="span2" name="weibo">
							<option></option>
							<option>新浪微博</option>
							<option>腾讯微博</option>
							<option>Twitter</option>
						</select>
				
							<span class="add-on">@</span><input class="span2" name="prependedInput" size="16" type="text" value="${person.introduction}"><span id="error_prependedInput"></span>
										
					</div>
				</div>	
				<div class="control-group">
					<label class="control-label" >简介*</label>
					<div class="controls">
						<textarea class="span5" rows="8" name="introduction">${person.jianjie}</textarea><span id="error_introduction"></span>
					</div>
				</div>
				<div style="margin-left:250px">
					<button type="button" id="btn" class="btn btn-primary">保存</button>
					<button class="btn" onclick="person.jspx">返回</button>
				</div>
			</fieldset>
		</form>
	</div>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#btn").click(function(){
				var username = $("input[name = 'username']").val();
				var company = $("input[name = 'company']").val();
				var phone = $("input[name = 'phone']").val();
				var tel = $("input[name = 'tel']").val();
				var email = $("input[name = 'email']").val();
				var address = $("input[name = 'address']").val();
				var book = $("input[name = 'book']").val();
				var weibo = $("input[name = 'weibo']").val();
				var prependedInput = $("input[name = 'prependedInput']").val();
				var introduction = $("input[name = 'introduction']").val();
				
				if(username == ""){
					$("#error_username").html("请输入名字");
					return;
				}
				
				if(phone == ""){
					$("#error_phone").html("请输入手机号");
					return;
				}
				if(introduction == ""){
					$("#error_introduction").html("请输入简介");
					return;
				}
				
				$("#myform").submit();
			});
		});
	</script>	
</body>
</html>

       
